import xlwt
class write:
    def write_excel(self):
        book=xlwt.Workbook()
        sheet=book.add_sheet("成绩")
        sheet.write(0,0,"姓名")
        sheet.write(0,1,"成绩")
        #list=[("a",90),("b",88),("c",99),("d",66),("e",77)]
        row=1
        for data in self:
            for col,filed in enumerate(data):
                sheet.write(row,col,filed)
            row+=1
        book.save("D:\桌面\成绩.xls")


